<template>
  <div class="balance">
    <van-nav-bar title="我的余额" left-arrow @click-left="onClickLeft" />
    <div class="box-money">
      <fieldset class="yu">
        <legend>&nbsp;&nbsp;余额&nbsp;&nbsp;</legend>
      </fieldset>
      <div class="money">
        <span>￥</span>
        <span class="m-190">190.00</span>
      </div>
      <div class="c-icon">
        <i>￥</i>
      </div>
      <div class="mingxi">余额明细</div>
      <div class="top-up" @click="recharge">充值</div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    onClickLeft() {
      this.$router.go(-1);
      this.$store.commit("tabShow");
    },
    recharge() {
      this.$router.push({
        name: "Recharge",
      });
    },
  },
  created() {
    this.$store.commit("tabHide");
  },
};
</script>

<style lang="scss">
.balance {
  background-color: #f2f4f8;

  .van-nav-bar__title {
    font-weight: bold;
    font-size: 16px;
    line-height: 150%;
    text-align: center;
    font-weight: bold;
  }
  .box-money {
    background-color: white;
    width: 260px;
    height: 260px;
    border-radius: 3px;
    border: 1px solid #f2f4f8;
    margin-top: 10rem;
    margin-left: 3.7rem;
    position: relative;

    .money {
      width: 140px;
      height: 50px;
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      right: 0;
      margin: auto;
      text-align: center;
      line-height: 50px;
      span {
        font-size: 16px;
      }
      .m-190 {
        font-size: 30px;
        font-weight: bold;
      }
    }
    .c-icon {
      position: absolute;
      top: -40px;
      left: 35%;
      width: 77px;
      height: 77px;
      color: rgba(80, 80, 80, 1);
      background-color: rgba(255, 195, 0, 1);
      border-radius: 39px;
      font-size: 16px;
      i {
        display: block;
        font-size: 40px;
        font-style: normal;
        text-align: center;
        line-height: 77px;
        color: white;
        font-weight: 900;
      }
    }
    .mingxi {
      position: absolute;
      top: 60%;
      left: 40%;
      font-size: 14px;
    }
    .yu {
      margin: 60px auto;
      width: 100px;
      text-align: center;
      border: 0;
      border-top: 1px solid black;
    }
    .top-up {
      width: 100%;
      height: 43px;
      line-height: 43px;
      background-color: red;
      text-align: center;
      position: absolute;
      bottom: 0;
    }
  }
}
</style>